include "stdarg.h";

function f(num: Int, b...) {
    printf("args: %i\n", num);
    for i in 0 ... num {
        var x: Int = b;
        printf("%i\n", x);
    }
}

function g(num: Int, args...) {
    vf(num, (args...));
}

function vf(num: Int, args: va_list) {
    printf("args: %i\n", num);
}

function main() {
    f(3, 1, 2, 3);
    f(5, 4, 5, 6, 7, 8);
    g(2, 1, 2);
}
